﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BaccaratRally.DataKernel.Entity;
using BaccaratRally.DataKernel.Service;


namespace BaccaratRally.Service.Api
{
    public partial class SetBet : System.Web.UI.Page
    {
        public int BetID;
        public Byte BetStatus;
        public String BetResult;
        public Decimal Profit;

        protected void Page_Load(object sender, EventArgs e)
        {
            BetID = int.Parse(Request.QueryString["BetID"]);
            BetStatus = Byte.Parse(Request.QueryString["BetStatus"]);
            BetItemService bis = ServiceFactory.CreateService<BetItemService>();


            if (BetStatus == 6)
            {
                BetResult = Request.QueryString["BetResult"];
                Profit = Decimal.Parse(Request.QueryString["BetProfit"]);

                bis.SetStatus(BetID, BetStatus, BetResult, Profit);
            }
            else
            {
                bis.SetStatus(BetID, BetStatus);
            }
        }
    }
}